package com.github.llyb120.stock;

import cn.hutool.core.io.FileUtil;
//import com.github.llyb120.namilite.init.NamiSpringFilter;
import com.github.llyb120.namilite.NamiSpringController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//import org.tuckey.web.filters.urlrewrite.*;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.charset.StandardCharsets;
import java.util.List;


//@RequestMapping("/a")
//@RestController
//@Component
//public class Ctrl {
//
//    public static Environment environment;
//    public static File dir;
//
//    @RequestMapping("/b")
//    public Object b(){
//        return "123";
//    }
//
//    //asdffda
//
//    @RequestMapping("/{c:[\\w\\W]+}")
//    public Object t(ServletRequest request){
////        NamiSpringFilter.class;
//        return "n";
//    }
//
//    @Autowired
//    public void set(@Autowired Environment env){
//        environment = env;
//        dir = new File(environment.getProperty("stock.path"));
//    }
//}
@RequestMapping("/api")
@RestController
public class Ctrl extends NamiSpringController {
    public static Environment environment;
    public static File dir;
    @Autowired
    public void set(@Autowired Environment env){
        environment = env;
        dir = new File(environment.getProperty("stock.path"));
    }
}
